package com.jiutong.meipengdai.http.model.requests;

import com.jiutong.meipengdai.http.RetrofitHandle;
import com.jiutong.meipengdai.http.SubscribeHandler;
import com.jiutong.meipengdai.http.model.services.HousessInfoService;

import java.util.Map;

import rx.Observable;
import rx.Subscriber;

/**
 * Created by suxi on 2017/5/31.
 */

public class HousessInfoRequest extends SubscribeHandler {
    /**
     *  房产信息
     * @param subscriber
     * @param fields
     */
    public void getHouse(Subscriber subscriber, Map<String, Object> fields) {

        fields.put("method", "user.houses");
        fields.put("v", "2.0");
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(HousessInfoService.class)
                .getHousess(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     *  评估列表
     * @param subscriber
     * @param fields
     */
    public void getEvaluateList(Subscriber subscriber, Map<String, Object> fields) {

        fields.put("method", "user.houseOnlineAssessmentInfos");
        fields.put("v", "2.0");
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(HousessInfoService.class)
                .getEvaluateList(fields);
        toSubscribe(observable, subscriber);
    }


    /**
     *  房产评估预览
     * @param subscriber
     * @param fields
     */
    public void getHousePingguPre(Subscriber subscriber, Map<String, Object> fields) {

        fields.put("method", "user.houseassessment.preview");
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(HousessInfoService.class)
                .getHousePingguPre(fields);
        toSubscribe(observable, subscriber);
    }


}
